package com.ule.activity;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
import tk.mybatis.spring.mapper.MapperScannerConfigurer;

import java.util.Properties;

@SpringBootApplication
@Configuration
//@EnableTransactionManagement
//@ServletComponentScan(basePackages = "com.ule.prize.prizeMgtService.filter")
public class StartUpApplication extends SpringBootServletInitializer {

	public static void main(String[] args) {
		ConfigurableApplicationContext app = SpringApplication.run(StartUpApplication.class, args);
		//SpringContextUtil.setApplicationContext(app);
	}

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
		// 注意这里要指向原先用main方法执行的Application启动类
		return builder.sources(StartUpApplication.class);
	}


	// string -> date
	@Autowired
	RequestMappingHandlerAdapter requestMappingHandlerAdapter;

	/*@PostConstruct
	public void initEditableValidation(){
		ConfigurableWebBindingInitializer configurableWebBindingInitializer = (ConfigurableWebBindingInitializer) requestMappingHandlerAdapter.getWebBindingInitializer();
		if(configurableWebBindingInitializer.getConversionService()!=null){
			GenericConversionService service = (GenericConversionService) configurableWebBindingInitializer.getConversionService();
			service.addConverter(new StringToDateConverter());
		}
	}*/



}

